<h1><span></span><?= lang('label_menu_link_private_messages'); ?></h1>

<ul class="breadcrumb">
    <li><a href="<?= base_url() ?>"><?= lang('label_home') ?></a></li>
    <li><a href="<?= base_url('user/profile') ?>"><?= lang('label_profile') ?></a></li>
    <li><?= lang('label_menu_link_private_messages'); ?></li>
</ul>


<div class="page">

    <?php $this->load->view('template/default/private/top') ?>

    <div style="overflow:hidden;">

        <?php $this->load->view('template/default/private/side') ?>

        <div class="profile_page">
            <h2 class="profile_page_title"><?= lang('label_menu_link_private_messages'); ?> &raquo; <strong><?= lang('label_outbox') ?></strong></h2>

            <?php if ($result) { ?>
                <table id="tablestyle">
                    <thead>
                        <tr>
                            <th><?= lang('label_subject') ?></th>
                            <th><?= lang('label_input_date') ?></th>
                            <th><?= lang('label_operation') ?></th>
                        </tr>
                    </thead>

                    <tbody>
                        <?php
                        foreach ($result as $value) {
                            ?>
                            <tr>
                                <td>
                                    <div class="checkbox">
                                        <a href="<?php echo base_url() . get_segment(1) ?>/view/<?php echo $value->id ?>/outbox"><?php echo $value->subject ?></a>
                                    </div>
                                </td>
                                <td><?= timespan($value->create_date) ?></td>
                                <td><a
                                        href="<?php echo base_url(); ?>private_messages/delete/<?php echo $value->id; ?>/outbox"
                                        id="confirm_delete" class="adelete"></a></td>
                            </tr>
                            <?php
                        }
                        ?>

                    </tbody>
                </table>

            <?php } else { ?>
                <div class="unsaved">
                    <img src="<?php echo str_replace('/index.php', '', $_SERVER['SCRIPT_NAME']) ?>/<?php echo APPPATH ?>views/<?php echo $this->themes->Cms_themes() ?>/images/unsaved.png" alt="" />
                    <br /><?= lang('message_no_messages_found') ?>
                </div>
                <br /><br /><br /><br />      
            <?php } ?>
        </div>
    </div>
</div>
